package com.dengdai.apputils.adapters;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.dengdai.applibrary.adapter.BaseCommAdapter;
import com.dengdai.apputils.R;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * @说明 测试列表数据源
 * @作者 LY
 * @时间 16/5/18 18:51
 * @邮箱 2743569843@qq.com
 * @版权 Copyright(c) 2016 LY-版权所有
 * @备注
 */
public class TextListAdapter extends BaseCommAdapter<String> {

    public TextListAdapter(Context context) {
        super(context);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if (convertView == null) {
            convertView = inflater.inflate(R.layout.common_test_list_item, null);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        holder.tvName.setText((String) getItem(position));
        return convertView;
    }

    class ViewHolder {
        @Bind(R.id.tvName)
        TextView tvName;
        @Bind(R.id.lineBg)
        LinearLayout lineBg;

        ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }
}
